package cn.rkylin.oms.warehouse.stockdiff.dao;

import java.util.UUID;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import cn.rkylin.core.IDataBaseFactory;
import cn.rkylin.oms.warehouse.stockdiff.domain.StockDiff;

/**
 * Created by Administrator on 2018-3-28.
 */
@Repository
public class StockDiffDAOImpl implements IStockDiffDAO{
    private String STATEMENT_INSERT_STOCK_DIFF = "insertSelectiveStockDiff";
    
    @Autowired
    protected IDataBaseFactory dao;

    @Override
    public int insertStockDiff(StockDiff stockDiff) throws Exception {
        stockDiff.setDiffId(UUID.randomUUID().toString().replaceAll("-", ""));
        int result = dao.insert(STATEMENT_INSERT_STOCK_DIFF, stockDiff);
        return result;
    }

}
